<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" :close-on-click-modal="false" class="tl-dialog" width="1200px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
			<el-row>
				<el-col :span="12">
					<el-form-item label="敏感词" prop="word" :rules="rules.validateRequire">
						<el-input v-model="model.word"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="有效" prop="enabled">
						<el-radio-group v-model="model.enabled">
							<el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-row>
			<!-- <el-row>
				<el-col :span="12">
					<el-form-item label="类型" prop="type" :rules="rules.validateRequire">
						<el-select v-model="model.type" filterable clearable>
							<el-option v-for="item in codeModel.typeList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
				<el-col :span="12">
					<el-form-item label="适用范围" prop="rangesys" :rules="rules.validateRequire">
						<el-select v-model="model.rangesys" filterable clearable>
							<el-option v-for="item in codeModel.rangesysList" :key="item.code" :label="item.name" :value="item.code" />
						</el-select>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="12">
					<el-form-item label="有效" prop="enabled">
						<el-radio-group v-model="model.enabled">
							<el-radio :label="parseInt(item.code)" v-for="item in codeModel.enabledList" :key="item.code">{{ item.name }}</el-radio>
						</el-radio-group>
					</el-form-item>
				</el-col>
			</el-row>
			<el-row>
				<el-col :span="24">
					<el-form-item label="提示：" prop="enabled">
						<span>过滤词用于过滤包含敏感词的词汇，例如敏感词为“敏感”，过滤词为“过滤敏感”，则录入“过滤敏感”不会被拦截。</span>
					</el-form-item>
				</el-col>
			</el-row> -->
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
/** 子组件 */
/** 工具类 */
import { putAction, getAction, postAction, deleteAction } from '@tapui/utils/http'
/** VUE配置 */
export default {
  mixins: [mixin_edit],
  components: { },
  data() {
    return {
      moduleTitle: '敏感词库',
      urlPrefix: '/mms/sensitiveThesaurus/',
      url: {
        // 额外的url
      }
    }
  },
  methods: {
    loaded() {
      // 页面加载完毕执行
    //   if (this.isAdd) {
    //     this.$set(this.model, 'type', '1')
    //     this.$set(this.model, 'rangesys', '1')
    //   }
    },
	assignDefaultValue() {
      if (this.isAdd) {
        this.$set(this.model, 'type', '1')
        this.$set(this.model, 'rangesys', '1')
      }
    }
  }
}
</script>

